Skip to content

Feature/INT-1702 - Airline and accommodation sub-tree model alignment - #676

Open
david-ruiz-cko wants to merge 4 commits into
masterfrom
feature/INT-1702
Open

david-ruiz-cko wants to merge 4 commits into
masterfrom
feature/INT-1702

Conversation

@david-ruiz-cko

Copy link
Copy Markdown
Contributor

This pull request introduces several important improvements and corrections to the payment industry data models, focusing on better alignment with the API specification, increased robustness in JSON (de)serialization, and enhanced documentation. The most significant changes include improved handling of polymorphic array/object fields, migration of several properties to more flexible types, and extensive JavaDoc updates for clarity and maintainability.

Improvements to JSON (de)serialization and data model flexibility:

  • Added a custom deserializer in GsonSerializer to handle fields that may be either a single object or an array (notably for airline passenger data), ensuring consistent internal representation as a list and always serializing as an array. This prevents data loss and aligns with the API's flexible input. [1] [2]
  • Updated Industry and related classes to map airline and accommodation properties as lists (List<AirlineData>, List<AccommodationData>) instead of single objects, matching the API specification and fixing previous serialization issues.

Data type corrections and deprecations:

  • Changed several fields from enum types (e.g., CountryCode) to plain String to accommodate the API's use of both two- and three-letter country codes, increasing compatibility. [1] [2]
  • Deprecated and documented old or duplicate classes and fields (e.g., PaymentContextsAccommodationData, serviceClass in FlightLegDetails, hubModelOriginationCountry in ProcessingSettings) to guide developers toward the preferred usage and maintain backward compatibility. [1] [2] [3]

Documentation and JavaDoc enhancements:

  • Added or improved JavaDoc comments across all affected classes and fields, providing clear descriptions, usage notes, and references to the API specification. This improves maintainability and developer understanding. [1] [2] [3] [4] [5] [6] [7] [8] [9]

New features and classes:

  • Introduced PartnerCustomerRiskData to represent merchant-specific key-value pairs for transaction risk data, supporting new API features and aligning with the latest specification. [1] [2]

Property and field corrections:

  • Updated property names and types for consistency with the specification (e.g., classOfTravelling, departureDate as LocalDate, numberOfNightsAtRoomRate as String), and clarified optionality and expected formats. [1] [2] [3]

These changes collectively improve the SDK's correctness, flexibility, and developer usability when handling payment industry-specific data.

@david-ruiz-cko
david-ruiz-cko requested a review from a team September 25, 2026 09:27
@agent-wall-e

agent-wall-e Bot commented Sep 25, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:433>250

Operational gates

  • ✅ jira_ticket (INT-1702)
  • ✅ independent_review

Files analysed: 27


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Sep 25, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
exceeds_bounded_scope — 433>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@agent-wall-e

agent-wall-e Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🟠 Advisory review: Concerns worth a look

This PR needs a human approval. Before you give it, these are the things I'd want resolved.

This PR realigns airline/accommodation data models with the API spec, fixing cardinality bugs (airline serialized as object instead of array), field type mismatches (CountryCode→String, Long→String for flightNumber), and adds a custom Gson adapter to handle passenger as either object or array. The logic is largely sound but there are several concrete issues worth resolving before approval.

Concerns

  • The singleOrArrayPassengerFactory write-side logic emits a bare object for a single passenger on AirlineData and PaymentContextsAirlineData, but the Javadoc comment on singleOrArrayDeserializer (the first, unmatched Javadoc block before singleOrArrayPassengerFactory) states 'Writing is handled by singleOrArrayPassengerFactory below, which...always serializing as an array' — this directly contradicts the actual factory behaviour of emitting an object for count==1, and one of the two Javadoc blocks appears to describe the wrong method entirely (the first block ends without a closing */ before the second block starts, suggesting a copy-paste merge error).
  • The round-trip invariant for a single passenger is broken: serialization writes a bare object ({"passenger":{...}}), but the singleOrArrayDeserializer only reads List<Passenger> — a bare object at the passenger key in the wire format will be caught by the deserializer and normalized to a one-element list correctly, but this depends on the registerTypeAdapter for List<Passenger> firing before the factory adapter on read, which is not guaranteed when a TypeAdapterFactory is also registered; a Gson TypeAdapterFactory takes precedence over registerTypeAdapter for the enclosing type (AirlineData), and the factory delegates to getDelegateAdapter, which may bypass the list deserializer.
  • The Industry class rename from airlineData→airline and accommodationData→accommodation is a breaking API change for any callers constructing Industry via the builder or accessing fields directly; the PR deprecates old fields in other classes but makes no mention of backward compatibility for Industry itself, and there is no @Deprecated annotation or migration path shown.
  • The FlightLegDetails field stopoverCode was renamed to stopOverCode (capital O), which is a breaking rename for existing callers; the old field had no @Deprecated retention path unlike serviceClass.
  • The numberOfNightsAtRoomRate type change from Integer to String in PaymentContextsAccommodationRoom is a binary-incompatible change for any caller reading this field from a deserialized response or setting it programmatically — existing code assigning an int/Integer will fail to compile.
  • The PaymentContextsProcessing.accommodationData field type changed from List<PaymentContextsAccommodationData> to List<AccommodationData> — this is a binary-incompatible change for any existing caller, and while PaymentContextsAccommodationData is now @Deprecated, callers who stored the result of getAccommodationData() as List<PaymentContextsAccommodationData> will get a compile error.
  • The Ticket.issueDate type changed from String to LocalDate, which is a silent deserialization behaviour change: any consumer that previously stored or compared it as a string will now need to handle LocalDate; no deprecation or migration note is provided.
  • The truncated diff means the full singleOrArrayPassengerFactory implementation (the write path, the delegate adapter wiring, and the empty-list branch) cannot be fully verified — the review notes the patch is truncated at the critical section.

⚠️ The diff was too large to read in full, so this review covers only part of the change.


This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02

@agent-wall-e

agent-wall-e Bot commented Sep 25, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:514>250

Operational gates

  • ✅ jira_ticket (INT-1702)
  • ✅ independent_review

Files analysed: 27


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Sep 25, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
exceeds_bounded_scope — 514>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

* global {@code LOWER_CASE_WITH_UNDERSCORES} naming policy and the {@code LocalDate} adapter
* still apply; this deserializer never maps property names itself.
*
* @param elementType the list element type
* still apply; this deserializer never maps property names itself.
*
* @param elementType the list element type
* @param <T> the list element type
@agent-wall-e

agent-wall-e Bot commented Sep 28, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • exceeds_bounded_scope:525>250

Operational gates

  • ✅ jira_ticket (INT-1702)
  • ✅ independent_review

Files analysed: 27


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Sep 28, 2026

Copy link
Copy Markdown
🔬 Debug — why this classification?

Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.

Reason code Kind Clause Meaning
exceeds_bounded_scope — 525>250 classifying §2.1 M8 More than 250 non-test, non-doc, non-lockfile lines changed.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants